<div class="animated fadeIn">

  <div class="row">

    <div class="form-group col-2" >

      <select name="select" class="form-control" [(ngModel)]="checkedData.type">
        <option value="">状态</option>
        <option value="1">未处理</option>
        <option value="2">已处理</option>
      </select>

    </div>
    <!--查询-->
    <div class="form-group col-1" style="padding-left:5px">
      <button type="button" class="btn btn-primary btn-radius" (click)="getMessageLists()">查询</button>
    </div>
  </div>

  <div class="table-responsive" style="margin-top: 20px">
    <table class="table table-center table-bordered table-hover" style="min-width: 0px">
      <thead class="table-inverse">
      <tr class="text-nowrap">
        <td>序号</td>
        <td>消息类型</td>
        <td>消息内容</td>
        <td>状态</td>
        <td>发送日期</td>
        <td>操作</td>
      </tr>
      </thead>
      <tbody class="tab-content">
        <tr *ngFor="let item of messageData let i = index">
          <td>{{i+1}}</td>
          <td>{{item.title}}</td>
          <td>{{item.content}}</td>
          <td>
            <span *ngIf="item.type == 1">未处理</span>
            <span *ngIf="item.type == 2">已处理</span>
          </td>
          <td>
            {{item.sendTime ? (item.sendTime*1000 | date: 'yyyy-MM-dd hh:mm:ss') : ''}}
          </td>
          <td>
            <a href="javascript:;" *ngIf="(item.type == 1 && item.title == '广告审核')" [routerLink]="['/../../advert/index/detail',item.id]">去处理</a>
            <a href="javascript:;" *ngIf="(item.type == 1 && item.title == '提现申请')" [routerLink]="['/../../withdrawal/index/remittance',item.id]">去处理</a>
            <a href="javascript:;" class="removeBtn" *ngIf="item.type == 2" (click)="delete (item.id);smallModal.show()">删除</a>
          </td>
        </tr>
      </tbody>
    </table>

    <p class="noneData" *ngIf="!messageData.length">暂无数据</p>

    <!--分页组件-->
    <div style="float: right">
      <pagination [boundaryLinks]="true" [totalItems]="totalItems" [(ngModel)]="currentPage" itemsPerPage="10" [maxSize]="maxSize" previousText="上一页" nextText="下一页" firstText="首页" lastText="末页" (pageChanged)="pageChanged($event)"></pagination>
    </div>
  </div>
</div>

<div bsModal #smallModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-primary modal-sm" [ngClass]="{'modal-danger': !shelvesorDeletes, 'modal-primary':shelvesorDeletes}" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">提示</h5>
        <button type="button" class="close" (click)="smallModal.hide()" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body" style="text-align: center" >
        <p style="margin: 0px" >{{modalText}}</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" (click)="smallModal.hide()">取消</button>
        <button  (click)="smallModal.hide()" type="button" class="btn btn-primary" [ngClass]="{'btn-danger': !shelvesorDeletes, 'btn-primary':shelvesorDeletes}"  (click)="smallModal.hide(); definiteRequest();" >确定</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div>

